package co.beto.commons
{
	import mx.core.UIComponent;
	
	public class SolidLine extends UIComponent
	{
		private var _thickness:Number = 1.0;
		
		public var VERTICAL:String = 'vertical';
		public var HORIZONTAL:String = 'horizontal';
		
		public function set thickness(value:Number):void
		{
			this._thickness = value;
		}
		
		public function get thickness():Number
		{
			return _thickness;
		}
		
		private var _color:uint;
		public function set color(value:uint):void
		{
			this._color = value;
		}
		
		public function get color():uint
		{
			return _color;
		}
		private var _direction:String;
		
		public function set direction(value:String):void
		{
			_direction = value;
		}
		
		public function get direction():String
		{
			return _direction;
		}		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			this.graphics.clear();
			this.graphics.lineStyle( _thickness, _color, 1);
			this.graphics.moveTo(0, 0);
			if(_direction == HORIZONTAL)
			{
				this.graphics.lineTo(unscaledWidth, 0);
			}
			else if (_direction == VERTICAL)
			{
				this.graphics.lineTo(0, unscaledHeight);
			}
		}
	}
}